<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/4 0004
 * Time: 22:49
 */
use yii\helpers\Url;
?>
<div class="panel">
    <div id="myCarousel" class="carousel slide" >
        <ol class="carousel-indicators">
            <!--        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>-->
            <!--        <li data-target="#carousel-example-generic" data-slide-to="1"></li>-->
            <!--        <li data-target="#carousel-example-generic" data-slide-to="2"></li>-->
            <?php foreach ($data['item'] as $k=>$list): ?>
                <li data-target="#carousel-example-generic" data-slide-to="<?=$k?>" class="<?=(isset($list['active'])&& $list['active']) ?'active':''?>"></li>
            <?php endforeach;?>
        </ol>
        <div class="carousel-inner">
            <!--        <div class="carousel-item active">-->
            <!--            <img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide">-->
            <!--        </div>-->
            <!--        <div class="carousel-item">-->
            <!--            <img data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide">-->
            <!--        </div>-->
            <!--        <div class="carousel-item">-->
            <!--            <img data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide">-->
            <!--        </div>-->
            <?php foreach ($data['item'] as  $k=>$list):?>
                <div class="item  <?=(isset($list['active'])&& $list['active'])? 'active':'' ?>">
                    <a href="<?=Url::to($list['url'])?>" ><img src="<?=$list['image_url']?> " alt="<?=$list['label']?>">
                        <div class="carousel-caption">
                            <?=$list['html']?>
                        </div>
                    </a>
                </div>
            <?php endforeach;?>
        </div>
        <a class="carousel-control left" href="#myCarousel" role="button" data-slide="prev">
            <span class="icon-prev" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="carousel-control right " href="#myCarousel" role="button" data-slide="next">
            <span class="icon-next" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>

</div>